<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\AdminUserStore;
use App\Models\AdminUser;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;

class AdminUsersController extends Controller
{
    public function index()
    {

    }

    public function store(AdminUserStore $request)
    {
        $attribute = $request->only(['name', 'username', 'password', 'status']);
        $attribute['password'] = Hash::make($attribute['password']);
        AdminUser::query()->create($attribute);
        return $this->message('创建成功');
    }

    public function update(Request $request, AdminUser $user)
    {

    }

    public function destroy()
    {

    }
}
